package monster.com.cvh.bean;

import java.util.List;

import static monster.com.cvh.constant.Constans.FINISH;
import static monster.com.cvh.constant.Constans.NO_DATA;
import static monster.com.cvh.constant.Constans.UNFINISH;

/**
 * @author: pengguanming
 * @data: 2018/4/20
 * @function:简历首页Bean
 */
public class ResumeMessageBean  {

    /**
     * code : 1
     * data : {"basic":{"birthday":"","email":"","gender":"","marriage":"","name":"","native_place":"","party":"","phone":"","qq":"","race":"","wechat":""},"edu_exps":[{"degree":"中专","enroll_time":"2013.04","graduate_time":"2024.01","id":56,"major":"明年可遇","school_name":"摸进行","update_time":"2018-04-26 09:07:23.840739"}],"honor_exps":[{"id":7,"obtain_time":"2018.01","scholarship_name":"明明","update_time":"2018-04-26 09:07:34.084030"},{"id":8,"obtain_time":"2018.04","scholarship_name":"jdjdj","update_time":"2018-04-26 09:07:34.084708"}],"icon_url":"http://tapi.cvh.io/icons/06aae91ccdf8d435511efeacdef05dcc.jpeg","job_prefer":{"industry":"咔咔咔","position":"","salary":"","work_city":"","work_type":"全职"},"project_exps":[{"begin_time":"2006.04","description":"pls路努力","end_time":"2018.04","id":5,"name":"kill咯啦","update_time":"2018-04-26 09:39:05.960863"}],"qulifications":[{"begin_time":"2024.04","end_time":"2018.04","id":6,"name":"lol哦啦","update_time":"2018-04-26 09:41:29.938732"}],"school_exps":[{"begin_time":"2006.05","duty_intro":"公司","duty_name":"回来铭","end_time":"2018.04","id":6,"update_time":"2018-04-25 22:37:46.014712"}],"self_intro":"","skills":[{"id":5,"level":"了解","name":"1","update_time":"2018-04-25 14:12:45.762559"},{"id":6,"level":"了解","name":"吐了路口了","update_time":"2018-04-25 14:12:45.763341"}],"work_exps":[{"begin_time":"2007.04","company_name":"阿卡","description":"绿拒绝具体考虑吐了","end_time":"2006.04","id":3,"position":"QQ","update_time":"2018-04-25 12:42:45.926965","work_type":"全职"}]}
     * msg : ok
     */

    private int code;
    private DataBean data;
    private String msg;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public DataBean getData() {
        return data;
    }

    public void setData(DataBean data) {
        this.data = data;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public static class DataBean {
        /**
         * basic : {"birthday":"","email":"","gender":"","marriage":"","name":"","native_place":"","party":"","phone":"","qq":"","race":"","wechat":""}
         * edu_exps : [{"degree":"中专","enroll_time":"2013.04","graduate_time":"2024.01","id":56,"major":"明年可遇","school_name":"摸进行","update_time":"2018-04-26 09:07:23.840739"}]
         * honor_exps : [{"id":7,"obtain_time":"2018.01","scholarship_name":"明明","update_time":"2018-04-26 09:07:34.084030"},{"id":8,"obtain_time":"2018.04","scholarship_name":"jdjdj","update_time":"2018-04-26 09:07:34.084708"}]
         * icon_url : http://tapi.cvh.io/icons/06aae91ccdf8d435511efeacdef05dcc.jpeg
         * job_prefer : {"industry":"咔咔咔","position":"","salary":"","work_city":"","work_type":"全职"}
         * project_exps : [{"begin_time":"2006.04","description":"pls路努力","end_time":"2018.04","id":5,"name":"kill咯啦","update_time":"2018-04-26 09:39:05.960863"}]
         * qulifications : [{"begin_time":"2024.04","end_time":"2018.04","id":6,"name":"lol哦啦","update_time":"2018-04-26 09:41:29.938732"}]
         * school_exps : [{"begin_time":"2006.05","duty_intro":"公司","duty_name":"回来铭","end_time":"2018.04","id":6,"update_time":"2018-04-25 22:37:46.014712"}]
         * self_intro :
         * skills : [{"id":5,"level":"了解","name":"1","update_time":"2018-04-25 14:12:45.762559"},{"id":6,"level":"了解","name":"吐了路口了","update_time":"2018-04-25 14:12:45.763341"}]
         * work_exps : [{"begin_time":"2007.04","company_name":"阿卡","description":"绿拒绝具体考虑吐了","end_time":"2006.04","id":3,"position":"QQ","update_time":"2018-04-25 12:42:45.926965","work_type":"全职"}]
         */

        private BasicBean basic;
        private String icon_url;
        private JobPreferBean job_prefer;
        private String self_intro;
        private List<EduExpsBean> edu_exps;
        private List<HonorExpsBean> honor_exps;
        private List<ProjectExpsBean> project_exps;
        private List<QulificationsBean> qulifications;
        private List<SchoolExpsBean> school_exps;
        private List<SkillsBean> skills;
        private List<WorkExpsBean> work_exps;

        private abstract static class CheckComplete{

            private static final long serialVersionUID = -5534801820242893975L;

            public abstract boolean checkouComplete();

        }

        /**
         * 从数组检查是否完整
         *
         * @param list
         * @param <T>
         * @return
         */
        public <T extends CheckComplete> int isCompleteFormList(List<T> list) {
            if (list.size() == 0) {
                return NO_DATA;
            }
            for (T t : list) {
                boolean isComplete = t.checkouComplete();
                if (isComplete == false) {
                    return UNFINISH;
                }
            }
            return FINISH;
        }

        /**
         * 从字符串检查是否完整
         *
         * @param content
         * @return
         */
        public static boolean isComplete(String content) {
            if (content == null || content.isEmpty()) {
                return false;
            } else {
                return true;
            }
        }

        public BasicBean getBasic() {
            return basic;
        }

        public void setBasic(BasicBean basic) {
            this.basic = basic;
        }

        public String getIcon_url() {
            return icon_url;
        }

        public void setIcon_url(String icon_url) {
            this.icon_url = icon_url;
        }

        public JobPreferBean getJob_prefer() {
            return job_prefer;
        }

        public void setJob_prefer(JobPreferBean job_prefer) {
            this.job_prefer = job_prefer;
        }

        public String getSelf_intro() {
            return self_intro;
        }

        public void setSelf_intro(String self_intro) {
            this.self_intro = self_intro;
        }

        public List<EduExpsBean> getEdu_exps() {
            return edu_exps;
        }

        public void setEdu_exps(List<EduExpsBean> edu_exps) {
            this.edu_exps = edu_exps;
        }

        public List<HonorExpsBean> getHonor_exps() {
            return honor_exps;
        }

        public void setHonor_exps(List<HonorExpsBean> honor_exps) {
            this.honor_exps = honor_exps;
        }

        public List<ProjectExpsBean> getProject_exps() {
            return project_exps;
        }

        public void setProject_exps(List<ProjectExpsBean> project_exps) {
            this.project_exps = project_exps;
        }

        public List<QulificationsBean> getQulifications() {
            return qulifications;
        }

        public void setQulifications(List<QulificationsBean> qulifications) {
            this.qulifications = qulifications;
        }

        public List<SchoolExpsBean> getSchool_exps() {
            return school_exps;
        }

        public void setSchool_exps(List<SchoolExpsBean> school_exps) {
            this.school_exps = school_exps;
        }

        public List<SkillsBean> getSkills() {
            return skills;
        }

        public void setSkills(List<SkillsBean> skills) {
            this.skills = skills;
        }

        public List<WorkExpsBean> getWork_exps() {
            return work_exps;
        }

        public void setWork_exps(List<WorkExpsBean> work_exps) {
            this.work_exps = work_exps;
        }

        public static class BasicBean {
            /**
             * birthday :
             * email :
             * gender :
             * marriage :
             * name :
             * native_place :
             * party :
             * phone :
             * qq :
             * race :
             * wechat :
             */

            private String birthday;
            private String email;
            private String gender;
            private String marriage;
            private String name;
            private String native_place;
            private String party;
            private String phone;
            private String qq;
            private String race;
            private String wechat;

            public int checkouComplete() {
                if (
                        isComplete(birthday) &&
                                isComplete(email) &&
                                isComplete(gender) &&
                                isComplete(marriage) &&
                                isComplete(name) &&
                                isComplete(native_place) &&
                                isComplete(party) &&
                                isComplete(phone) &&
                                isComplete(qq) &&
                                isComplete(race) &&
                                isComplete(wechat)
                        ) {
                    return FINISH;
                }else if (
                             !isComplete(birthday) &&
                             !isComplete(email) &&
                             !isComplete(gender) &&
                             !isComplete(marriage) &&
                             !isComplete(name) &&
                             !isComplete(native_place) &&
                             !isComplete(party) &&
                             !isComplete(phone) &&
                             !isComplete(qq) &&
                             !isComplete(race) &&
                             !isComplete(wechat)
                        ) {
                    return NO_DATA;
                }
                return UNFINISH;
            }

            @Override
            public String toString() {
                return "BasicBean{" +
                        "birthday='" + birthday + '\'' +
                        ", email='" + email + '\'' +
                        ", gender='" + gender + '\'' +
                        ", marriage='" + marriage + '\'' +
                        ", name='" + name + '\'' +
                        ", native_place='" + native_place + '\'' +
                        ", party='" + party + '\'' +
                        ", phone='" + phone + '\'' +
                        ", qq='" + qq + '\'' +
                        ", race='" + race + '\'' +
                        ", wechat='" + wechat + '\'' +
                        '}';
            }

            public String getBirthday() {
                return birthday;
            }

            public void setBirthday(String birthday) {
                this.birthday = birthday;
            }

            public String getEmail() {
                return email;
            }

            public void setEmail(String email) {
                this.email = email;
            }

            public String getGender() {
                return gender;
            }

            public void setGender(String gender) {
                this.gender = gender;
            }

            public String getMarriage() {
                return marriage;
            }

            public void setMarriage(String marriage) {
                this.marriage = marriage;
            }

            public String getName() {
                return name;
            }

            public void setName(String name) {
                this.name = name;
            }

            public String getNative_place() {
                return native_place;
            }

            public void setNative_place(String native_place) {
                this.native_place = native_place;
            }

            public String getParty() {
                return party;
            }

            public void setParty(String party) {
                this.party = party;
            }

            public String getPhone() {
                return phone;
            }

            public void setPhone(String phone) {
                this.phone = phone;
            }

            public String getQq() {
                return qq;
            }

            public void setQq(String qq) {
                this.qq = qq;
            }

            public String getRace() {
                return race;
            }

            public void setRace(String race) {
                this.race = race;
            }

            public String getWechat() {
                return wechat;
            }

            public void setWechat(String wechat) {
                this.wechat = wechat;
            }
        }

        public static class JobPreferBean {
            /**
             * industry : 咔咔咔
             * position :
             * salary :
             * work_city :
             * work_type : 全职
             */

            private String industry;
            private String position;
            private String salary;
            private String work_city;
            private String work_type;

            public int  checkouComplete() {
                if (
                                isComplete(industry) &&
                                isComplete(position) &&
                                isComplete(salary) &&
                                isComplete(work_city) &&
                                isComplete(work_type)
                        ) {
                    return FINISH;
                }else if (
                        !isComplete(industry) &&
                        !isComplete(position) &&
                        !isComplete(salary) &&
                        !isComplete(work_city) &&
                        !isComplete(work_type)){
                    return NO_DATA;
                }else {
                    return UNFINISH;
                }
            }

            @Override
            public String toString() {
                return "JobPreferBean{" +
                        "industry='" + industry + '\'' +
                        ", position='" + position + '\'' +
                        ", salary='" + salary + '\'' +
                        ", work_city='" + work_city + '\'' +
                        ", work_type='" + work_type + '\'' +
                        '}';
            }

            public String getIndustry() {
                return industry;
            }

            public void setIndustry(String industry) {
                this.industry = industry;
            }

            public String getPosition() {
                return position;
            }

            public void setPosition(String position) {
                this.position = position;
            }

            public String getSalary() {
                return salary;
            }

            public void setSalary(String salary) {
                this.salary = salary;
            }

            public String getWork_city() {
                return work_city;
            }

            public void setWork_city(String work_city) {
                this.work_city = work_city;
            }

            public String getWork_type() {
                return work_type;
            }

            public void setWork_type(String work_type) {
                this.work_type = work_type;
            }
        }

        public static class EduExpsBean extends CheckComplete{
            /**
             * degree : 中专
             * enroll_time : 2013.04
             * graduate_time : 2024.01
             * id : 56
             * major : 明年可遇
             * school_name : 摸进行
             * update_time : 2018-04-26 09:07:23.840739
             */

            private String degree;
            private String enroll_time;
            private String graduate_time;
            private int id;
            private String major;
            private String school_name;
            private String update_time;

            public boolean checkouComplete() {
                if (
                        isComplete(degree) &&
                                isComplete(enroll_time) &&
                                isComplete(graduate_time) &&
                                isComplete(major) &&
                                isComplete(school_name)
                        ) {
                    return true;
                }
                return false;
            }

            public String getDegree() {
                return degree;
            }

            public void setDegree(String degree) {
                this.degree = degree;
            }

            public String getEnroll_time() {
                return enroll_time;
            }

            public void setEnroll_time(String enroll_time) {
                this.enroll_time = enroll_time;
            }

            public String getGraduate_time() {
                return graduate_time;
            }

            public void setGraduate_time(String graduate_time) {
                this.graduate_time = graduate_time;
            }

            public int getId() {
                return id;
            }

            public void setId(int id) {
                this.id = id;
            }

            public String getMajor() {
                return major;
            }

            public void setMajor(String major) {
                this.major = major;
            }

            public String getSchool_name() {
                return school_name;
            }

            public void setSchool_name(String school_name) {
                this.school_name = school_name;
            }

            public String getUpdate_time() {
                return update_time;
            }

            public void setUpdate_time(String update_time) {
                this.update_time = update_time;
            }
        }

        public static class HonorExpsBean extends CheckComplete{
            /**
             * id : 7
             * obtain_time : 2018.01
             * scholarship_name : 明明
             * update_time : 2018-04-26 09:07:34.084030
             */

            private int id;
            private String obtain_time;
            private String scholarship_name;
            private String update_time;

            public boolean checkouComplete() {
                if (
                        isComplete(obtain_time) &&
                                isComplete(scholarship_name)
                        ) {
                    return true;
                }
                return false;
            }

            public int getId() {
                return id;
            }

            public void setId(int id) {
                this.id = id;
            }

            public String getObtain_time() {
                return obtain_time;
            }

            public void setObtain_time(String obtain_time) {
                this.obtain_time = obtain_time;
            }

            public String getScholarship_name() {
                return scholarship_name;
            }

            public void setScholarship_name(String scholarship_name) {
                this.scholarship_name = scholarship_name;
            }

            public String getUpdate_time() {
                return update_time;
            }

            public void setUpdate_time(String update_time) {
                this.update_time = update_time;
            }
        }

        public static class ProjectExpsBean extends CheckComplete{
            /**
             * begin_time : 2006.04
             * description : pls路努力
             * end_time : 2018.04
             * id : 5
             * name : kill咯啦
             * update_time : 2018-04-26 09:39:05.960863
             */

            private String begin_time;
            private String description;
            private String end_time;
            private int id;
            private String name;
            private String update_time;

            public boolean checkouComplete() {
                if (
                        isComplete(begin_time) &&
                                isComplete(description) &&
                                isComplete(end_time) &&
                                isComplete(name)
                        ) {
                    return true;
                }
                return false;
            }

            public String getBegin_time() {
                return begin_time;
            }

            public void setBegin_time(String begin_time) {
                this.begin_time = begin_time;
            }

            public String getDescription() {
                return description;
            }

            public void setDescription(String description) {
                this.description = description;
            }

            public String getEnd_time() {
                return end_time;
            }

            public void setEnd_time(String end_time) {
                this.end_time = end_time;
            }

            public int getId() {
                return id;
            }

            public void setId(int id) {
                this.id = id;
            }

            public String getName() {
                return name;
            }

            public void setName(String name) {
                this.name = name;
            }

            public String getUpdate_time() {
                return update_time;
            }

            public void setUpdate_time(String update_time) {
                this.update_time = update_time;
            }
        }

        public static class QulificationsBean extends CheckComplete{
            /**
             * begin_time : 2024.04
             * end_time : 2018.04
             * id : 6
             * name : lol哦啦
             * update_time : 2018-04-26 09:41:29.938732
             */

            private String begin_time;
            private String end_time;
            private int id;
            private String name;
            private String update_time;

            public boolean checkouComplete() {
                if (
                        isComplete(begin_time) &&
                                isComplete(end_time) &&
                                isComplete(name)
                        ) {
                    return true;
                }
                return false;
            }

            public String getBegin_time() {
                return begin_time;
            }

            public void setBegin_time(String begin_time) {
                this.begin_time = begin_time;
            }

            public String getEnd_time() {
                return end_time;
            }

            public void setEnd_time(String end_time) {
                this.end_time = end_time;
            }

            public int getId() {
                return id;
            }

            public void setId(int id) {
                this.id = id;
            }

            public String getName() {
                return name;
            }

            public void setName(String name) {
                this.name = name;
            }

            public String getUpdate_time() {
                return update_time;
            }

            public void setUpdate_time(String update_time) {
                this.update_time = update_time;
            }
        }

        public static class SchoolExpsBean extends CheckComplete{
            /**
             * begin_time : 2006.05
             * duty_intro : 公司
             * duty_name : 回来铭
             * end_time : 2018.04
             * id : 6
             * update_time : 2018-04-25 22:37:46.014712
             */

            private String begin_time;
            private String duty_intro;
            private String duty_name;
            private String end_time;
            private int id;
            private String update_time;

            public boolean checkouComplete() {
                if (
                        isComplete(begin_time) &&
                                isComplete(end_time) &&
                                isComplete(duty_intro) &&
                                isComplete(duty_name)
                        ) {
                    return true;
                }
                return false;
            }

            public String getBegin_time() {
                return begin_time;
            }

            public void setBegin_time(String begin_time) {
                this.begin_time = begin_time;
            }

            public String getDuty_intro() {
                return duty_intro;
            }

            public void setDuty_intro(String duty_intro) {
                this.duty_intro = duty_intro;
            }

            public String getDuty_name() {
                return duty_name;
            }

            public void setDuty_name(String duty_name) {
                this.duty_name = duty_name;
            }

            public String getEnd_time() {
                return end_time;
            }

            public void setEnd_time(String end_time) {
                this.end_time = end_time;
            }

            public int getId() {
                return id;
            }

            public void setId(int id) {
                this.id = id;
            }

            public String getUpdate_time() {
                return update_time;
            }

            public void setUpdate_time(String update_time) {
                this.update_time = update_time;
            }
        }

        public static class SkillsBean extends CheckComplete{
            /**
             * id : 5
             * level : 了解
             * name : 1
             * update_time : 2018-04-25 14:12:45.762559
             */

            private int id;
            private String level;
            private String name;
            private String update_time;

            public boolean checkouComplete() {
                if (
                        isComplete(level) &&
                                isComplete(name)
                        ) {
                    return true;
                }
                return false;
            }

            public int getId() {
                return id;
            }

            public void setId(int id) {
                this.id = id;
            }

            public String getLevel() {
                return level;
            }

            public void setLevel(String level) {
                this.level = level;
            }

            public String getName() {
                return name;
            }

            public void setName(String name) {
                this.name = name;
            }

            public String getUpdate_time() {
                return update_time;
            }

            public void setUpdate_time(String update_time) {
                this.update_time = update_time;
            }
        }

        public static class WorkExpsBean extends CheckComplete{
            /**
             * begin_time : 2007.04
             * company_name : 阿卡
             * description : 绿拒绝具体考虑吐了
             * end_time : 2006.04
             * id : 3
             * position : QQ
             * update_time : 2018-04-25 12:42:45.926965
             * work_type : 全职
             */

            private String begin_time;
            private String company_name;
            private String description;
            private String end_time;
            private int id;
            private String position;
            private String update_time;
            private String work_type;


            public boolean checkouComplete() {
                if (
                        isComplete(begin_time) &&
                                isComplete(description) &&
                                isComplete(end_time) &&
                                isComplete(position) &&
                                isComplete(work_type) &&
                                isComplete(company_name)
                        ) {
                    return true;
                }
                return false;
            }

            public String getBegin_time() {
                return begin_time;
            }

            public void setBegin_time(String begin_time) {
                this.begin_time = begin_time;
            }

            public String getCompany_name() {
                return company_name;
            }

            public void setCompany_name(String company_name) {
                this.company_name = company_name;
            }

            public String getDescription() {
                return description;
            }

            public void setDescription(String description) {
                this.description = description;
            }

            public String getEnd_time() {
                return end_time;
            }

            public void setEnd_time(String end_time) {
                this.end_time = end_time;
            }

            public int getId() {
                return id;
            }

            public void setId(int id) {
                this.id = id;
            }

            public String getPosition() {
                return position;
            }

            public void setPosition(String position) {
                this.position = position;
            }

            public String getUpdate_time() {
                return update_time;
            }

            public void setUpdate_time(String update_time) {
                this.update_time = update_time;
            }

            public String getWork_type() {
                return work_type;
            }

            public void setWork_type(String work_type) {
                this.work_type = work_type;
            }
        }
    }
}
